VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClsPago"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Public WithEvents orset As ClsRecordset
Attribute orset.VB_VarHelpID = -1

Public Event DataChanged()

Public codigo As String
Public codNodo As String
Public codGestion As String
Public codTipo As String
Public codCobrador As String
Public codFactura As String

Public fecha As String
Public monto As Double
Public recibo As String
Public cheque As String
Public codBanco As String

Private Sub Class_Initialize()
    Set orset = New ClsRecordset
    orset.setCampos dbCampos(pag)
    orset.setTablas Array(pag)
End Sub
Private Sub Class_Terminate()
    Set orset = Nothing
End Sub
'consultas varias
Public Sub consulta()
    orset.consulta
End Sub
Public Sub consultaDeFactura(facturaCod As String)
    orset.consulta Array(pag_fac_id & "='" & facturaCod & "'")
End Sub
'metodos de clase
Public Sub AsignaAFactura(facturaCod As String)
    orset.sUpdateGral Array(pag_fac_id), _
                      Array(facturaCod), _
                      Array(pag), _
                      Array(pag_id & "='" & Me.codigo & "'"), False
End Sub
Public Sub EliminaDeFactura(facturaCod As String)
    orset.sDelete Array(pag_fac_id & "='" & facturaCod & "'")
End Sub
'metodos para ABM
Public Sub Nuevo(newFecha As String, newMonto As String, _
                 newRecNumero As String, newCheque As String, newCodBanco As String, _
                 newCodNodo As String, newCodGestion As String, newCodTipoPago As String, _
                 newCodCobrador As String, newCodFactura As String)
    orset.sInsert Array("", newCodNodo, newCodGestion, newCodTipoPago, _
                        newCodCobrador, newCodFactura, _
                        newFecha, newMonto, newRecNumero, newCheque, newCodBanco)
End Sub
Public Sub Modificar(codig As String, newFecha As String, newMonto As String, newRecNumero As String, newCheque As String, newCodBanco As String, _
                                      newCodNodo As String, newCodGestion As String, newCodTipoPago As String, _
                                      newCodCobrador As String, newCodFactura As String)
    orset.sUpdate Array(codig, newCodNodo, newCodGestion, newCodTipoPago, _
                        newCodCobrador, newCodFactura, _
                        newFecha, newMonto, newRecNumero, newCheque, newCodBanco)
End Sub
Public Sub Borrar(codig As String)
    orset.sDelete Array(pag_id & "='" & codig & "'")
End Sub
'metodo para recuperacion de datos en el objeto
Private Sub Reload_members()
    With orset
        codigo = .getDato(pag_id)
        codNodo = .getDato(pag_nod_id)
        codGestion = .getDato(pag_ges_id)
        codTipo = .getDato(pag_tpa_id)
        codCobrador = .getDato(pag_cob_id)
        codFactura = .getDato(pag_fac_id)
        fecha = .getDato(pag_fecha)
        monto = .getDato(pag_monto)
        recibo = .getDato(pag_recibo)
        cheque = .getDato(pag_cheque)
        codBanco = .getDato(pag_ban_id)
    End With
    RaiseEvent DataChanged
End Sub

Private Sub orset_DataChanged()
    Reload_members
End Sub
